home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LT_SetAttributes.c < prev    next >
C/C++ Source or Header  |  1996-10-08  |  30KB  |  1,414 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. VOID
  15. LT_SetAttributes(LayoutHandle *handle,LONG id,...)
  16. {
  17.     va_list VarArgs;
  18.  
  19.     va_start(VarArgs,id);
  20.     LT_SetAttributesA(handle,id,(struct TagItem *)VarArgs);
  21.     va_end(VarArgs);
  22. }
  23.  
  24.  
  25. /*****************************************************************************/
  26.  
  27.  
  28. VOID
  29. LTP_AddAllAndRefreshThisGadget(LayoutHandle *Handle,struct Gadget *Gadget)
  30. {
  31.     AddGList(Handle->Window,Handle->List,(UWORD)-1,(UWORD)-1,NULL);
  32.     RefreshGList(Gadget,Handle->Window,NULL,1);
  33. }
  34.  
  35. VOID
  36. LTP_FixState(LayoutHandle *Handle,BOOL State,struct Gadget *Gadget,UWORD Bit)
  37. {
  38.     if(Gadget)
  39.     {
  40.         LTP_StripGadgets(Handle,Handle->List);
  41.  
  42.         if(State)
  43.             Gadget->Flags |=  Bit;
  44.         else
  45.             Gadget->Flags &= ~Bit;
  46.  
  47.         LTP_AddAllAndRefreshThisGadget(Handle,Gadget);
  48.     }
  49. }
  50.  
  51. BOOL
  52. LTP_NotifyPager(LayoutHandle *Handle,LONG ID,LONG Page)
  53. {
  54.     if(ID != -1)
  55.     {
  56.         LT_SetAttributes(Handle,ID,
  57.             LAGR_ActivePage,Page,
  58.         TAG_DONE);
  59.  
  60.         if(Handle->Failed)
  61.             return(FALSE);
  62.     }
  63.  
  64.     return(TRUE);
  65. }
  66.  
  67.  
  68. /*****************************************************************************/
  69.  
  70.  
  71. /****** gtlayout.library/LT_SetAttributesA ******************************************
  72. *
  73. *   NAME
  74. *    LT_SetAttributesA -- Change object attributes
  75. *
  76. *   SYNOPSIS
  77. *    LT_SetAttributesA(Handle,ID,Tags);
  78. *                        A0   D0  A1
  79. *
  80. *    VOID LT_SetAttributes(LayoutHandle *,LONG,struct TagItem *);
  81. *
  82. *    LT_SetAttributes(Handle,ID,...);
  83. *
  84. *    VOID LT_SetAttributes(LayoutHandle *,LONG,...);
  85. *
  86. *   FUNCTION
  87. *    This routine passes the tag item list it gets directly
  88. *    over to GT_SetGadgetAttrsA(), so any tag items valid for
  89. *    gadtools.library can be used here as well. Some filtering
  90. *    may be done in order to stop objects from getting redrawn
  91. *    if this is not absolutely necessary.
  92. *
  93. *   INPUTS
  94. *    Handle - Pointer to LayoutHandle.
  95. *
  96. *    ID - ID number of the object to change. This is the same value
  97. *        you passed via LA_ID to LT_New() when you created this object.
  98. *
  99. *    Tags - Attributes controlling object states.
  100. *
  101. *
  102. *    All gadtools.library tags are allowed, but not all are supported.
  103. *    In addition to these tags a few additional tag values are
  104. *    supported:
  105. *
  106. *    LAHN_AutoActivate (BOOL) - Set to TRUE if you want the interface
  107. *        to always keep a string gadget active if possible. Hitting
  108. *        the return key will then cause the next following string
  109. *        gadget to get activated, either cycling through all the
  110. *        string gadgets available or stopping at the next string
  111. *        gadget to have the LAST_LastGadget attribute set.
  112. *
  113. *    LAHN_UserData (APTR) - Store user specific data in the
  114. *        LayoutHandle->UserData entry. (V9)
  115. *
  116. *    LAHN_RawKeyFilter (BOOL) - Discard unprocessed IDCMP_RAWKEY
  117. *        events. (V13)
  118. *        Default: TRUE
  119. *
  120. *    LAHN_LocaleHook (struct Hook *) - The hook to call when
  121. *        locale string IDs are to be mapped to strings. The
  122. *        hook function is called with the following parameters:
  123. *
  124. *        String = HookFunc(struct Hook *Hook,struct LayoutHandle *Handle,
  125. *          D0                            A0                         A2
  126. *                          LONG ID)
  127. *                               A1
  128. *
  129. *        The function is to look up the string associated with the ID
  130. *        passed in and return the string.
  131. *
  132. *    LAHN_ExitFlush (BOOL) - When the LayoutHandle is finally disposed
  133. *        of with LT_DeleteHandle() all variables maintained by the
  134. *        input handling code will be flushed. For example, if you
  135. *        would use the LA_STRPTR tag for STRING_KIND objects the
  136. *        last string gadget contents would be copied into the buffer
  137. *        pointed to by LA_STRPTR. If you do not want to use this
  138. *        feature, disable it with "LAHN_ExitFlush,FALSE". (V9)
  139. *        Default: TRUE
  140. *
  141. *    GAUGE_KIND:
  142. *
  143. *        LAGA_Percent (LONG) - Percentage of the gauge to fill.
  144. *
  145. *        LAGA_InfoText (STRPTR) - Text to be printed within the
  146. *            gauge display, such as a percentage number.
  147. *
  148. *    BOX_KIND:
  149. *
  150. *        LABX_Index (LONG) - The number of the line to change, this
  151. *            tag works in conjunction with the LABX_Text tag.
  152. *
  153. *        LABX_Text (STRPTR) - The text to put into the line indicated
  154. *            by the LABX_Index tag.
  155. *            As of v26 the LABX_Index tag may be omitted, the library
  156. *            will then assume the line index will be 0.
  157. *
  158. *        LABX_Lines (STRPTR *) - The text to set for the box contents,
  159. *            terminate the text array with NULL.
  160. *
  161. *    HORIZONTAL_KIND:
  162. *    VERTICAL_KIND:
  163. *
  164. *        LAGR_ActivePage (LONG) - Index number of page to display
  165. *            within the group.
  166. *
  167. *                NOTE: requires that this group was created
  168. *                    with the LAGR_ActivePage attribute set.
  169. *
  170. *    INTEGER_KIND:
  171. *
  172. *        LAIN_Min (LONG) - Minimum allowed value for this
  173. *            object.
  174. *
  175. *        LAIN_Max (LONG) - Maximum allowed value for this
  176. *            object.
  177. *
  178. *    LISTVIEW_KIND:
  179. *
  180. *        LALV_Selected (LONG) - Combines GTLV_Selected and
  181. *            GTLV_Top (for Kickstart V37) or GTLV_MakeVisible
  182. *            (for Kickstart V39 and greater). This means, the
  183. *            list display will be changed in order to show
  184. *            the item to be selected. (V34)
  185. *
  186. *    PASSWORD_KIND:
  187. *
  188. *        LAPW_String (STRPTR) - Secret text to use
  189. *
  190. *    POPUP_KIND
  191. *
  192. *        LAPU_Labels (STRPTR *) - To block access to the popup
  193. *            menu, for example before you free the current list
  194. *            of labels, you can pass ~0 as the list parameter. (V25)
  195. *
  196. *    STRING_KIND:
  197. *
  198. *        LAST_CursorPosition (LONG) - Repositions the cursor,
  199. *            pass -1 to move it to the end of the string. (V7)
  200. *
  201. *    TAPEDECK_KIND:
  202. *
  203. *        LATD_Pressed (BOOL) - TRUE to make this button shown
  204. *            as pressed, FALSE to show it in depressed state.
  205. *
  206. *    BOOPSI_KIND:
  207. *
  208. *        All tags are passed straight through to SetGadgetAttrs(..).
  209. *
  210. *    All objects:
  211. *
  212. *        LA_LabelText (STRPTR) - New gadget label text to use.
  213. *
  214. *        LA_LabelID (LONG) - Locale text ID to use for this object.
  215. *
  216. *   RESULT
  217. *    none
  218. *
  219. *   SEE ALSO
  220. *    gadtools.library/GT_SetGadgetAttrsA()
  221. *    intuition.library/SetGadgetAttrsA
  222. *
  223. ******************************************************************************
  224. *
  225. */
  226.  
  227. VOID LIBENT
  228. LT_SetAttributesA(REG(a0) LayoutHandle *handle,REG(d0) LONG id,REG(a1) struct TagItem *TagList)
  229. {
  230.     if(handle && TagList)
  231.     {
  232.         struct Gadget    *Gadget = NULL;
  233.         struct TagItem    *ThisTag,*ThisList = TagList;
  234.         ObjectNode        *Node = NULL;
  235.  
  236.         while(ThisTag = NextTagItem(&ThisList))
  237.         {
  238.             switch(ThisTag->ti_Tag)
  239.             {
  240.                 case LH_AutoActivate:
  241.  
  242.                     handle->AutoActivate = ThisTag->ti_Data;
  243.                     break;
  244.  
  245.                 case LH_RawKeyFilter:
  246.  
  247.                     handle->RawKeyFilter = ThisTag->ti_Data;
  248.                     break;
  249.  
  250.                 case LH_UserData:
  251.  
  252.                     handle->UserData = (APTR)ThisTag->ti_Data;
  253.                     break;
  254.  
  255.                 case LH_ExitFlush:
  256.  
  257.                     handle->ExitFlush = ThisTag->ti_Data;
  258.                     break;
  259.  
  260.                 case LH_LocaleHook:
  261.  
  262.                     handle->LocaleHook = (struct Hook *)ThisTag->ti_Data;
  263.                     break;
  264.  
  265.                 case LAPR_Gadget:
  266.  
  267.                     Gadget = (struct Gadget *)ThisTag->ti_Data;
  268.                     break;
  269.  
  270.                 case LAPR_Object:
  271.  
  272.                     Node = (ObjectNode *)ThisTag->ti_Data;
  273.                     break;
  274.             }
  275.         }
  276.  
  277.         if(Node)
  278.             Gadget = Node->Host;
  279.         else
  280.         {
  281.             if(Gadget)
  282.             {
  283.                 if(Node = (ObjectNode *)Gadget->UserData)
  284.                 {
  285.                     if(Node->Host != Gadget || Node->PointBack != Node)
  286.                         Node = NULL;
  287.                 }
  288.             }
  289.         }
  290.  
  291.         if(!Gadget)
  292.         {
  293.             if(Gadget = LTP_FindGadget(handle,id))
  294.             {
  295.                 if(Node = (ObjectNode *)Gadget->UserData)
  296.                 {
  297.                     if(Node->Host != Gadget || Node->PointBack != Node)
  298.                         Node = NULL;
  299.                 }
  300.             }
  301.             else
  302.                 Node = LTP_FindNode(handle,id);
  303.         }
  304.  
  305.         if(Node)
  306.         {
  307.             STATIC Tag Filter[] = { GA_Disabled,TAG_DONE };
  308.  
  309.             struct TagItem    *NewTags = NULL;
  310.             ULONG             Exclude = NULL;
  311.  
  312.             switch(Node->Type)
  313.             {
  314. #ifdef DO_PASSWORD_KIND
  315.                 case PASSWORD_KIND:
  316.  
  317.                     if(ThisTag = FindTagItem(GTST_String,TagList))
  318.                     {
  319.                         STRPTR String;
  320.                         LONG Len;
  321.  
  322.                         String = (STRPTR)TagList->ti_Data;
  323.  
  324.                         if(String)
  325.                             Len = strlen(String);
  326.                         else
  327.                         {
  328.                             String = "";
  329.                             Len = 0;
  330.                         }
  331.  
  332.                         Exclude = GTST_String;
  333.  
  334.                         strcpy(Node->Special.String.RealString,String);
  335.  
  336.                         if(Len)
  337.                         {
  338.                             memset(Node->Special.String.Original,'·',Len);
  339.                             Node->Special.String.Original[Len] = 0;
  340.                         }
  341.  
  342.                         GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  343.                             GTST_String,Node->Special.String.Original,
  344.                         TAG_DONE);
  345.                     }
  346.  
  347.                     break;
  348. #endif
  349. #ifdef DO_BOOPSI_KIND
  350.                 case BOOPSI_KIND:
  351.  
  352.                     if(ThisTag = FindTagItem(GA_Disabled,TagList))
  353.                         Node->Disabled = ThisTag->ti_Data;
  354.  
  355.                     if(Node->Special.BOOPSI.TagCurrent)
  356.                     {
  357.                         if(ThisTag = FindTagItem(Node->Special.BOOPSI.TagCurrent,TagList))
  358.                             Node->Current = ThisTag->ti_Data;
  359.                     }
  360.  
  361.                     if(Node->Host)
  362.                         SetGadgetAttrsA(Node->Host,handle->Window,NULL,TagList);
  363.  
  364.                     return;
  365. #endif    /* DO_BOOPSI_KIND */
  366.                 case STRING_KIND:
  367.  
  368.                     if(ThisTag = FindTagItem(GTST_String,TagList))
  369.                     {
  370.                         Exclude = GTST_String;
  371.  
  372.                         if(Gadget)
  373.                         {
  374.                             GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  375.                                 GTST_String,ThisTag->ti_Data,
  376.                             TAG_DONE);
  377.                         }
  378.                         else
  379.                         {
  380.                             if(!Node->Special.String.Backup)
  381.                                 Node->Special.String.Backup = (STRPTR)LTP_Alloc(handle,Node->Special.String.MaxChars + 1);
  382.  
  383.                             if(Node->Special.String.Backup)
  384.                             {
  385.                                 if(ThisTag->ti_Data)
  386.                                     strcpy(Node->Special.String.Backup,(STRPTR)ThisTag->ti_Data);
  387.                                 else
  388.                                     Node->Special.String.Backup[0] = 0;
  389.  
  390.                                 Node->Special.String.String = Node->Special.String.Backup;
  391.                             }
  392.                         }
  393.                     }
  394.  
  395.                     if(Gadget)
  396.                     {
  397.                         if(ThisTag = FindTagItem(LAST_CursorPosition,TagList))
  398.                         {
  399.                             struct StringInfo    *StringInfo = Gadget->SpecialInfo;
  400.                             LONG                 Position,Len;
  401.  
  402.                             LTP_StripGadgets(handle,handle->List);
  403.  
  404.                             Position = (LONG)ThisTag->ti_Data;
  405.  
  406.                             Len = strlen(StringInfo->Buffer);
  407.  
  408.                             if(Position == -1)
  409.                                 Position = Len;
  410.                             else
  411.                             {
  412.                                 if(Position < 0)
  413.                                     Position = 0;
  414.                                 else
  415.                                 {
  416.                                     if(Position > Len)
  417.                                         Position = Len;
  418.                                 }
  419.                             }
  420.  
  421.                             StringInfo->BufferPos = Position;
  422.  
  423.                             LTP_AddAllAndRefreshThisGadget(handle,Gadget);
  424.                         }
  425.                     }
  426.  
  427.                     break;
  428.  
  429. #ifdef DO_LEVEL_KIND
  430.                 case LEVEL_KIND:
  431.                 {
  432.                     LevelExtra    *Special    = &Node->Special.Level;
  433.                     LONG         Level        = Node->Current,
  434.                                  Min        = Node->Min,
  435.                                  Max        = Node->Max,
  436.                                  Plus        = Special->Plus;
  437.                     BOOL         ChangeIt    = FALSE;
  438.  
  439.                     if(ThisTag = FindTagItem(LAVL_Level,TagList))
  440.                     {
  441.                         if((LONG)ThisTag->ti_Data != Level)
  442.                         {
  443.                             Level = (LONG)ThisTag->ti_Data;
  444.  
  445.                             ChangeIt = TRUE;
  446.                         }
  447.                     }
  448.  
  449.                     if(ThisTag = FindTagItem(LAVL_Min,TagList))
  450.                     {
  451.                         if((LONG)ThisTag->ti_Data != Min)
  452.                         {
  453.                             Plus = Min = (LONG)ThisTag->ti_Data;
  454.  
  455.                             ChangeIt = TRUE;
  456.                         }
  457.                     }
  458.  
  459.                     if(ThisTag = FindTagItem(LAVL_Max,TagList))
  460.                     {
  461.                         if((LONG)ThisTag->ti_Data != Max)
  462.                         {
  463.                             Max = (LONG)ThisTag->ti_Data;
  464.  
  465.                             ChangeIt = TRUE;
  466.                         }
  467.                     }
  468.  
  469.                     if(Max < Min)
  470.                     {
  471.                         Max = Min;
  472.                         ChangeIt = TRUE;
  473.                     }
  474.  
  475.                     if(Level > Max)
  476.                     {
  477.                         Level = Max;
  478.                         ChangeIt = TRUE;
  479.                     }
  480.  
  481.                     if(Level < Min)
  482.                     {
  483.                         Level = Min;
  484.                         ChangeIt = TRUE;
  485.                     }
  486.  
  487.                     if(ChangeIt && Gadget && handle->Window)
  488.                     {
  489.                         Node->Current    = Level;
  490.                         Node->Min        = Min;
  491.                         Node->Max        = Max;
  492.                         Special->Plus    = Plus;
  493.  
  494.                         LTP_PutStorage(Node);
  495.  
  496.                         SetAttrs(Special->LevelImage,
  497.                             LVIA_Current,    Node->Current    - Plus,
  498.                             LVIA_Max,        Node->Max        - Plus,
  499.                         TAG_DONE);
  500.  
  501.                         DrawImageState(&handle->RPort,Special->LevelImage,Gadget->LeftEdge,Gadget->TopEdge,IDS_NORMAL,handle->DrawInfo);
  502.  
  503.                         LTP_LevelGadgetDrawLabel(Gadget,FALSE);
  504.                     }
  505.  
  506.                     break;
  507.                 }
  508. #endif    /* DO_LEVEL_KIND */
  509.                 case CHECKBOX_KIND:
  510.  
  511.                     if(ThisTag = FindTagItem(GTCB_Checked,TagList))
  512.                     {
  513.                         if((Node->Current && ThisTag->ti_Data) || (!Node->Current && !ThisTag->ti_Data))
  514.                             Exclude = GTCB_Checked;
  515.                         else
  516.                         {
  517.                             Node->Current = ThisTag->ti_Data;
  518.  
  519.                             LTP_PutStorage(Node);
  520.                         }
  521.                     }
  522.  
  523.                     break;
  524.  
  525. #ifdef DO_TAPEDECK_KIND
  526.                 case TAPEDECK_KIND:
  527.  
  528.                     if(ThisTag = FindTagItem(LATD_Pressed,TagList))
  529.                     {
  530.                         if(Node->Current != ThisTag->ti_Data && Node->Special.TapeDeck.Toggle)
  531.                         {
  532.                             Node->Current = ThisTag->ti_Data;
  533.  
  534.                             LTP_FixState(handle,Node->Current,Gadget,GFLG_SELECTED);
  535.                         }
  536.                     }
  537.  
  538.                     break;
  539. #endif    /* DO_TAPEDECK_KIND */
  540.  
  541. #ifdef DO_GAUGE_KIND
  542.                 case GAUGE_KIND:
  543.                 {
  544.                     LONG Percent         = (LONG)Node->Current;
  545.                     BOOL NeedRefresh    = FALSE;
  546.                     BOOL FullRefresh    = FALSE;
  547.  
  548.                     if(ThisTag = FindTagItem(LAGA_Percent,TagList))
  549.                     {
  550.                         Percent = (LONG)ThisTag->ti_Data;
  551.  
  552.                         if(Percent < 0)
  553.                             Percent = 0;
  554.                         else
  555.                         {
  556.                             if(Percent > 100)
  557.                                 Percent = 100;
  558.                         }
  559.  
  560.                         if(Percent != (LONG)Node->Current)
  561.                             NeedRefresh = TRUE;
  562.                     }
  563.  
  564.                     if(ThisTag = FindTagItem(LAGA_InfoText,TagList))
  565.                     {
  566.                         STRPTR SomeText = (STRPTR)ThisTag->ti_Data;
  567.  
  568.                         if(Node->Special.Gauge.InfoLength)
  569.                         {
  570.                             LONG Len = strlen(SomeText);
  571.  
  572.                             if(Len > Node->Special.Gauge.InfoLength)
  573.                                 Len = Node->Special.Gauge.InfoLength;
  574.  
  575.                             CopyMem(SomeText,Node->Special.Gauge.InfoText,Len);
  576.  
  577.                             Node->Special.Gauge.InfoText[Len] = 0;
  578.  
  579.                             NeedRefresh = TRUE;
  580.                         }
  581.                     }
  582.  
  583.                     if(ThisTag = FindTagItem(GA_Disabled,TagList))
  584.                     {
  585.                         if(Node->Disabled != ThisTag->ti_Data)
  586.                         {
  587.                             FullRefresh = Node->Disabled;
  588.                             NeedRefresh = TRUE;
  589.  
  590.                             Node->Disabled = ThisTag->ti_Data;
  591.                         }
  592.                     }
  593.  
  594.                     if(NeedRefresh && Gadget)
  595.                         LTP_DrawGauge(handle,Node,Percent,FullRefresh);
  596.                 }
  597.  
  598.                 return;
  599. #endif
  600.                 case LISTVIEW_KIND:
  601.  
  602.                     if(ThisTag = FindTagItem(GTLV_Labels,TagList))
  603.                     {
  604.                         Node->Special.List.Labels = (struct List *)ThisTag->ti_Data;
  605.  
  606.                         if(ThisTag->ti_Data == (ULONG)~0)
  607.                             Node->Min = Node->Max = -1;
  608.                         else
  609.                         {
  610.                             struct List    *List;
  611.                             LONG         Count = 0;
  612.                             struct Node    *Item;
  613.  
  614.                             if(ThisTag->ti_Data)
  615.                                 List = (struct List *)ThisTag->ti_Data;
  616.                             else
  617.                             {
  618.                                 STATIC Tag Filter[] = { GTLV_Labels,TAG_DONE };
  619.  
  620.                                 LONG Current = (LONG)GetTagData(GTLV_Selected,(ULONG)Node->Current,TagList);
  621.  
  622.                                 if(!NewTags)
  623.                                 {
  624.                                     if(!(NewTags = CloneTagItems(TagList)))
  625.                                         return;
  626.                                 }
  627.  
  628.                                 FilterTagItems(NewTags,Filter,TAGFILTER_NOT);
  629.  
  630.                                 List = (struct List *)<P_EmptyList;
  631.  
  632.                                 GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  633.                                     GTLV_Labels,    List,
  634.                                     GTLV_Selected,    Current,
  635.                                 TAG_DONE);
  636.  
  637.                                 Node->Special.List.Labels = List;
  638.  
  639.                                 kprintf("GTLV_Labels: current = %ld\n",Current);
  640.                             }
  641.  
  642.                             SCANLIST(List,Item)
  643.                             {
  644.                                 Count++;
  645.                             }
  646.  
  647.                             Node->Min = 0;
  648.  
  649.                             if(Count)
  650.                                 Node->Max = Count - 1;
  651.                             else
  652.                                 Node->Max = 0;
  653.                         }
  654.                     }
  655.  
  656.                     if(ThisTag = FindTagItem(GTLV_Selected,TagList))
  657.                     {
  658.                         Node->Current = (LONG)ThisTag->ti_Data;
  659.  
  660.                         if(Gadget)
  661.                         {
  662.                             Exclude = GTLV_Selected;
  663.  
  664.                             GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  665.                                 GTLV_Selected,        Node->Current,
  666.                                 GTLV_Labels,        Node->Special.List.Labels,
  667.                             TAG_DONE);
  668.                         }
  669.  
  670.                         LTP_PutStorage(Node);
  671.  
  672.                         if(!LTP_NotifyPager(handle,Node->Special.List.AutoPageID,Node->Current))
  673.                             return;
  674.                     }
  675.  
  676.                     if(ThisTag = FindTagItem(LALV_Selected,TagList))
  677.                     {
  678.                         Node->Current = (LONG)ThisTag->ti_Data;
  679.  
  680.                         if(Gadget)
  681.                         {
  682.                             ULONG WhichTag;
  683.  
  684.                             if(V39)
  685.                                 WhichTag = GTLV_MakeVisible;
  686.                             else
  687.                                 WhichTag = GTLV_Top;
  688.  
  689.                             Exclude = LALV_Selected;
  690.  
  691.                             GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  692.                                 GTLV_Selected,        Node->Current,
  693.                                 GTLV_Labels,        Node->Special.List.Labels,
  694.  
  695.                                 (Node->Current < 0) ? TAG_DONE : TAG_IGNORE,0,
  696.  
  697.                                 WhichTag,            Node->Current,
  698.                             TAG_DONE);
  699.                         }
  700.  
  701.                         LTP_PutStorage(Node);
  702.  
  703.                         if(!LTP_NotifyPager(handle,Node->Special.List.AutoPageID,Node->Current))
  704.                             return;
  705.                     }
  706.  
  707.                     if(ThisTag = FindTagItem(GA_Disabled,TagList))
  708.                     {
  709.                         if(!V39)
  710.                         {
  711.                             if(!NewTags)
  712.                             {
  713.                                 if(!(NewTags = CloneTagItems(TagList)))
  714.                                     return;
  715.                             }
  716.  
  717.                             FilterTagItems(NewTags,Filter,TAGFILTER_NOT);
  718.                         }
  719.                     }
  720.  
  721.                     break;
  722.  
  723.                 case MX_KIND:
  724.  
  725.                     if(ThisTag = FindTagItem(GTMX_Active,TagList))
  726.                     {
  727.                         if(Node->Current == ThisTag->ti_Data)
  728.                             Exclude = GTMX_Active;
  729.                         else
  730.                         {
  731.                             Node->Current = ThisTag->ti_Data;
  732.  
  733.                             LTP_PutStorage(Node);
  734.  
  735.                             if(!LTP_NotifyPager(handle,Node->Special.Radio.AutoPageID,Node->Current))
  736.                                 return;
  737.                         }
  738.                     }
  739.  
  740.                     if(!V39)
  741.                     {
  742.                         if(FindTagItem(GA_Disabled,TagList))
  743.                         {
  744.                             if(!(NewTags = CloneTagItems(TagList)))
  745.                                 return;
  746.                             else
  747.                                 FilterTagItems(NewTags,Filter,TAGFILTER_NOT);
  748.                         }
  749.                     }
  750.  
  751.                     break;
  752.  
  753.                 case CYCLE_KIND:
  754.  
  755.                     if(ThisTag = FindTagItem(GTCY_Active,TagList))
  756.                     {
  757.                         if(Node->Current == ThisTag->ti_Data)
  758.                             Exclude = GTCY_Active;
  759.                         else
  760.                         {
  761.                             Node->Current = ThisTag->ti_Data;
  762.  
  763.                             LTP_PutStorage(Node);
  764.  
  765.                             if(!LTP_NotifyPager(handle,Node->Special.Cycle.AutoPageID,Node->Current))
  766.                                 return;
  767.                         }
  768.                     }
  769.  
  770.                     if(ThisTag = FindTagItem(GTCY_Labels,TagList))
  771.                     {
  772.                         STRPTR    *Strings;
  773.                         LONG     Count = 0;
  774.  
  775.                         if(Strings = (STRPTR *)ThisTag->ti_Data)
  776.                         {
  777.                             while(Strings[Count])
  778.                                 Count++;
  779.                         }
  780.  
  781.                         if(Count)
  782.                             Node->Max = Count - 1;
  783.                         else
  784.                             Node->Max = 0;
  785.                     }
  786.  
  787.                     break;
  788. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  789.                 case POPUP_KIND:
  790.                 {
  791.                     BOOL NewCurrent = FALSE,NewLabels = FALSE;
  792.  
  793.                     if(ThisTag = FindTagItem(GA_Disabled,TagList))
  794.                         Node->Disabled = ThisTag->ti_Data;
  795.  
  796.                     if(ThisTag = FindTagItem(LAPU_Labels,TagList))
  797.                     {
  798.                         STRPTR    *Strings;
  799.                         LONG     Count = 0;
  800.  
  801.                         if(Strings = (STRPTR *)ThisTag->ti_Data)
  802.                         {
  803.                             while(Strings[Count])
  804.                                 Count++;
  805.                         }
  806.  
  807.                         if(Count)
  808.                             Node->Max = Count - 1;
  809.                         else
  810.                             Node->Max = 0;
  811.  
  812.                         Node->Special.Popup.Choices = (STRPTR *)ThisTag->ti_Data;
  813.  
  814.                         DB(kprintf("max: %ld\n",Node->Max));
  815.  
  816.                         NewLabels = TRUE;
  817.                     }
  818.  
  819.                     if(ThisTag = FindTagItem(LAPU_Active,TagList))
  820.                     {
  821.                         DB(kprintf("current: %ld tag: %ld\n",Node->Current,ThisTag->ti_Data));
  822.  
  823.                         if(Node->Current != ThisTag->ti_Data)
  824.                         {
  825.                             Node->Current = ThisTag->ti_Data;
  826.  
  827.                             LTP_PutStorage(Node);
  828.  
  829.                             if(!LTP_NotifyPager(handle,Node->Special.Popup.AutoPageID,Node->Current))
  830.                                 return;
  831.  
  832.                             NewCurrent = TRUE;
  833.                         }
  834.                     }
  835.  
  836.                     if(Node->Host)
  837.                     {
  838.                         SetGadgetAttrs(Node->Host,handle->Window,NULL,
  839.                             NewCurrent ? PIA_Active : TAG_IGNORE,    Node->Current,
  840.                             NewLabels ? PIA_Labels : TAG_IGNORE,    Node->Special.Popup.Choices,
  841.                         TAG_MORE,TagList);
  842.                     }
  843.  
  844.                     return;
  845.                 }
  846. #endif
  847.  
  848. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  849.                 case TAB_KIND:
  850.                 {
  851.                     if(ThisTag = FindTagItem(GA_Disabled,TagList))
  852.                         Node->Disabled = ThisTag->ti_Data;
  853.  
  854.                     if(ThisTag = FindTagItem(LATB_Active,TagList))
  855.                     {
  856.                         DB(kprintf("current: %ld tag: %ld\n",Node->Current,ThisTag->ti_Data));
  857.  
  858.                         if(Node->Current != ThisTag->ti_Data)
  859.                         {
  860.                             Node->Current = ThisTag->ti_Data;
  861.  
  862.                             LTP_PutStorage(Node);
  863.  
  864.                             if(!LTP_NotifyPager(handle,Node->Special.Tab.AutoPageID,Node->Current))
  865.                                 return;
  866.                             else
  867.                             {
  868.                                 if(Node->Host)
  869.                                 {
  870.                                     SetGadgetAttrs(Node->Host,handle->Window,NULL,
  871.                                         TIA_Index,Node->Current,
  872.                                     TAG_MORE,TagList);
  873.                                 }
  874.                             }
  875.                         }
  876.                     }
  877.  
  878.                     return;
  879.                 }
  880. #endif
  881.                 case PALETTE_KIND:
  882.  
  883.                     if(ThisTag = FindTagItem(GTPA_Color,TagList))
  884.                     {
  885.                         if(Node->Current == ThisTag->ti_Data)
  886.                             Exclude = GTPA_Color;
  887.                         else
  888.                         {
  889.                             Node->Current = ThisTag->ti_Data;
  890.  
  891.                             LTP_PutStorage(Node);
  892.  
  893.                             if(Node->Special.Palette.UsePicker)
  894.                             {
  895.                                 if(Gadget)
  896.                                     LTP_DrawPalette(handle,Node);
  897.  
  898.                                 return;
  899.                             }
  900.                         }
  901.                     }
  902.  
  903.                     break;
  904.  
  905.                 case INTEGER_KIND:
  906.  
  907.                     if(ThisTag = FindTagItem(GTIN_Number,TagList))
  908.                     {
  909.                         LONG num = ThisTag->ti_Data;
  910.  
  911.                         if(num < Node->Min)
  912.                             num = Node->Min;
  913.                         else
  914.                         {
  915.                             if(num > Node->Max)
  916.                                 num = Node->Max;
  917.                         }
  918.  
  919.                         if(Gadget)
  920.                         {
  921. #ifdef DO_HEXHOOK
  922.                             if(!Node->Special.Integer.EditHook || Node->Special.Integer.CustomHook)
  923.                             {
  924.                                 UBYTE                 buffer[20];
  925.                                 struct StringInfo    *stringInfo;
  926.  
  927.                                 SPrintf(buffer,"%ld",num);
  928.  
  929.                                 Exclude = GTIN_Number;
  930.  
  931.                                 GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  932.                                     GTST_String,    buffer,
  933.                                     GTIN_Number,    num,
  934.                                 TAG_DONE);
  935.  
  936.                                 stringInfo = (struct StringInfo *)Gadget->SpecialInfo;
  937.  
  938.                                 stringInfo->LongInt = num;
  939.                             }
  940.                             else
  941.                             {
  942.                                 UBYTE                 buffer[40];
  943.                                 struct StringInfo    *stringInfo;
  944.                                 STRPTR                 Index;
  945.                                 LONG                 Value,Number = num,
  946.                                                      Scale,Sign;
  947.  
  948.                                 stringInfo = (struct StringInfo *)Gadget->SpecialInfo;
  949.  
  950.                                 Index = stringInfo->Buffer;
  951.  
  952.                                 while(*Index && *Index == ' ')
  953.                                     Index++;
  954.  
  955.                                 switch(Index[0])
  956.                                 {
  957.                                     case '$':
  958.  
  959.                                         SPrintf(buffer,"$%lx",num);
  960.                                         break;
  961.  
  962.                                     case '&':
  963.  
  964.                                         if(Number < 0)
  965.                                         {
  966.                                             Sign = -1;
  967.                                             Number = -Number;
  968.                                         }
  969.                                         else
  970.                                             Sign = 1;
  971.  
  972.                                         for(Value = 0, Scale = 1 ; Number ; Number /= 8, Scale *= 10)
  973.                                             Value += (Number & 7) * Scale;
  974.  
  975.                                         SPrintf(buffer,"&%ld",(LONG)(Sign * Value));
  976.                                         break;
  977.  
  978.                                     case '%':
  979.  
  980.                                         if(Number < 0)
  981.                                         {
  982.                                             Sign = -1;
  983.                                             Number = -Number;
  984.                                         }
  985.                                         else
  986.                                             Sign = 1;
  987.  
  988.                                         for(Value = 0, Scale = 1 ; Number ; Number /= 2, Scale *= 10)
  989.                                             Value += (Number & 1) * Scale;
  990.  
  991.                                         SPrintf(buffer,"%%%ld",(LONG)(Sign * Value));
  992.                                         break;
  993.  
  994.                                     case '0':
  995.  
  996.                                         if(Index[1] == 'x')
  997.                                         {
  998.                                             SPrintf(buffer,"0x%lx",num);
  999.                                             break;
  1000.                                         }
  1001.  
  1002.                                         // Fall through to...
  1003.  
  1004.                                     default:
  1005.  
  1006.                                         SPrintf(buffer,"%ld",num);
  1007.                                         break;
  1008.                                 }
  1009.  
  1010.                                 Exclude = GTIN_Number;
  1011.  
  1012.                                 GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  1013.                                     GTST_String,buffer,
  1014.                                 TAG_DONE);
  1015.  
  1016.                                 stringInfo->LongInt = num;
  1017.                             }
  1018. #else
  1019.                             GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  1020.                                 GTIN_Number,num,
  1021.                             TAG_DONE);
  1022. #endif
  1023.                         }
  1024.  
  1025.                         Node->Special.Integer.Number = num;
  1026.  
  1027.                         LTP_PutStorage(Node);
  1028.                     }
  1029.  
  1030.                     break;
  1031.  
  1032.                 case NUMBER_KIND:
  1033.  
  1034.                     if(ThisTag = FindTagItem(GTNM_Number,TagList))
  1035.                         Node->Special.Number.Number = ThisTag->ti_Data;
  1036.  
  1037.                     break;
  1038.  
  1039.                 case SLIDER_KIND:
  1040.  
  1041.                     if(ThisTag = FindTagItem(GTSL_Level,TagList))
  1042.                     {
  1043.                         if(Node->Current == ThisTag->ti_Data)
  1044.                             Exclude = GTSL_Level;
  1045.                         else
  1046.                         {
  1047.                             Node->Current = ThisTag->ti_Data;
  1048.  
  1049.                             LTP_PutStorage(Node);
  1050.                         }
  1051.                     }
  1052.  
  1053.                     if(ThisTag = FindTagItem(GTSL_Min,TagList))
  1054.                     {
  1055.                         Node->Min = ThisTag->ti_Data;
  1056.  
  1057.                         if(Node->Current < Node->Min)
  1058.                         {
  1059.                             Node->Current = Node->Min;
  1060.  
  1061.                             LTP_PutStorage(Node);
  1062.                         }
  1063.                     }
  1064.  
  1065.                     if(ThisTag = FindTagItem(GTSL_Max,TagList))
  1066.                     {
  1067.                         Node->Max = ThisTag->ti_Data;
  1068.  
  1069.                         if(Node->Current > Node->Max)
  1070.                         {
  1071.                             Node->Current = Node->Max;
  1072.  
  1073.                             LTP_PutStorage(Node);
  1074.                         }
  1075.                     }
  1076.  
  1077.                     break;
  1078.  
  1079.                 case SCROLLER_KIND:
  1080.  
  1081.                     if(ThisTag = FindTagItem(GTSC_Top,TagList))
  1082.                     {
  1083.                         if(Node->Current == ThisTag->ti_Data)
  1084.                             Exclude = GTSC_Top;
  1085.                         else
  1086.                         {
  1087.                             Node->Current = ThisTag->ti_Data;
  1088.  
  1089.                             LTP_PutStorage(Node);
  1090.                         }
  1091.                     }
  1092.  
  1093.                     if(ThisTag = FindTagItem(GTSC_Total,TagList))
  1094.                     {
  1095.                         Node->Max = ThisTag->ti_Data;
  1096.  
  1097.                         if(Node->Current > Node->Max)
  1098.                         {
  1099.                             Node->Current = Node->Max;
  1100.  
  1101.                             LTP_PutStorage(Node);
  1102.                         }
  1103.                     }
  1104.  
  1105.                     if(ThisTag = FindTagItem(GTSC_Visible,TagList))
  1106.                         Node->Special.Scroller.Visible = ThisTag->ti_Data;
  1107.  
  1108.                     break;
  1109.  
  1110.                 case BOX_KIND:
  1111.                 {
  1112.                     BOOL Visible = Node->Special.Box.Parent->Special.Group.Visible;
  1113.  
  1114.                     if(ThisTag = FindTagItem(LABX_Text,TagList))
  1115.                     {
  1116.                         STRPTR    Text = (STRPTR)ThisTag->ti_Data;
  1117.                         LONG    Index;
  1118.  
  1119.                         Index = (LONG)GetTagData(LABX_Index,0,TagList);
  1120.  
  1121.                         if(Index >= 0 && Index < Node->Lines)
  1122.                         {
  1123.                             if(Node->Special.Box.ReserveSpace)
  1124.                             {
  1125.                                 LONG Len = strlen(Text);
  1126.  
  1127.                                 if(Len > Node->Special.Box.MaxSize)
  1128.                                     Len = Node->Special.Box.MaxSize;
  1129.  
  1130.                                 CopyMem(Text,Node->Special.Box.Lines[Index],Len);
  1131.  
  1132.                                 Node->Special.Box.Lines[Index][Len] = 0;
  1133.                             }
  1134.                             else
  1135.                                 Node->Special.Box.Lines[Index] = Text;
  1136.                         }
  1137.  
  1138.                         if(Visible)
  1139.                             LTP_PrintBoxLine(handle,Node,Index);
  1140.                     }
  1141.  
  1142.                     if(ThisTag = FindTagItem(LABX_Lines,TagList))
  1143.                     {
  1144.                         STRPTR    *Lines = (STRPTR *)ThisTag->ti_Data;
  1145.                         LONG     i;
  1146.  
  1147.                         if(Node->Special.Box.ReserveSpace)
  1148.                         {
  1149.                             LONG Len;
  1150.  
  1151.                             for(i = 0 ; i < Node->Lines ; i++)
  1152.                             {
  1153.                                 if(Lines[i])
  1154.                                 {
  1155.                                     Len = strlen(Lines[i]);
  1156.  
  1157.                                     if(Len > Node->Special.Box.MaxSize)
  1158.                                         Len = Node->Special.Box.MaxSize;
  1159.  
  1160.                                     CopyMem(Lines[i],Node->Special.Box.Lines[i],Len);
  1161.  
  1162.                                     Node->Special.Box.Lines[i][Len] = 0;
  1163.  
  1164.                                     if(Visible)
  1165.                                         LTP_PrintBoxLine(handle,Node,i);
  1166.                                 }
  1167.                                 else
  1168.                                     break;
  1169.                             }
  1170.                         }
  1171.                         else
  1172.                         {
  1173.                             for(i = 0 ; i < Node->Lines ; i++)
  1174.                             {
  1175.                                 if(Lines[i])
  1176.                                 {
  1177.                                     Node->Special.Box.Lines[i] = Lines[i];
  1178.  
  1179.                                     if(Visible)
  1180.                                         LTP_PrintBoxLine(handle,Node,i);
  1181.                                 }
  1182.                                 else
  1183.                                     break;
  1184.                             }
  1185.                         }
  1186.                     }
  1187.  
  1188.                     break;
  1189.                 }
  1190.  
  1191.                 case TEXT_KIND:
  1192.  
  1193.                     if(ThisTag = FindTagItem(GTTX_Text,TagList))
  1194.                     {
  1195.                         STRPTR text = (STRPTR)ThisTag->ti_Data;
  1196.  
  1197.                         if(!text)
  1198.                             text = "";
  1199.  
  1200.                         if(Node->Special.Text.CopyText)
  1201.                         {
  1202.                             LONG len;
  1203.  
  1204.                             if(Node->Special.Text.Text)
  1205.                                 len = strlen(Node->Special.Text.Text) + 1;
  1206.                             else
  1207.                                 len = 0;
  1208.  
  1209.                             if(len)
  1210.                                 LTP_Free(handle,Node->Special.Text.Text,len);
  1211.  
  1212.                             len = strlen(text);
  1213.  
  1214.                             if(Node->Special.Text.Text = LTP_Alloc(handle,len + 1))
  1215.                                 strcpy(Node->Special.Text.Text,text);
  1216.                         }
  1217.                         else
  1218.                             Node->Special.Text.Text = text;
  1219.                     }
  1220.  
  1221.                     if(ThisTag = FindTagItem(GTTX_FrontPen,TagList))
  1222.                         Node->Special.Text.FrontPen = (WORD)ThisTag->ti_Data;
  1223.  
  1224.                     if(ThisTag = FindTagItem(GTTX_BackPen,TagList))
  1225.                         Node->Special.Text.BackPen = (WORD)ThisTag->ti_Data;
  1226.  
  1227.                     break;
  1228.  
  1229.                 case GROUP_KIND:
  1230.  
  1231.                     if(Node->Special.Group.Paging)
  1232.                     {
  1233.                         if(ThisTag = FindTagItem(LAGR_ActivePage,TagList))
  1234.                         {
  1235.                             ObjectNode *node;
  1236.  
  1237.                             node = Node;
  1238.  
  1239.                             if(node->Type == GROUP_KIND)
  1240.                             {
  1241.                                 if(node->Special.Group.ActivePage != ThisTag->ti_Data)
  1242.                                 {
  1243.                                     LONG    Left    = node->Left,
  1244.                                             Top        = node->Top,
  1245.                                             Width    = node->Width,
  1246.                                             Height    = node->Height;
  1247.  
  1248.                                     if(node->Label || node->Special.Group.Frame)
  1249.                                     {
  1250.                                         Left    += 4 + handle->GlyphWidth;
  1251.                                         Width    -= 2 * (4 + handle->GlyphWidth);
  1252.  
  1253.                                         if(node->Label)
  1254.                                         {
  1255.                                             Top        += handle->GlyphHeight;
  1256.                                             Height    -= handle->GlyphHeight + 3;
  1257.                                         }
  1258.                                         else
  1259.                                         {
  1260.                                             Top        += 2;
  1261.                                             Height    -= 5;
  1262.                                         }
  1263.                                     }
  1264.  
  1265.                                     node->Special.Group.ActivePage = ThisTag->ti_Data;
  1266.  
  1267.                                     LT_LockWindow(handle->Window);
  1268.  
  1269.                                     LTP_EraseBox(&handle->RPort,Left,Top,Width,Height);
  1270.  
  1271.                                     LT_RebuildTagList(handle,FALSE,NULL);
  1272.  
  1273.                                     LT_UnlockWindow(handle->Window);
  1274.                                 }
  1275.                             }
  1276.                         }
  1277.                     }
  1278.  
  1279.                     break;
  1280.             }
  1281.  
  1282.             if(ThisTag = FindTagItem(LA_LabelText,TagList))
  1283.                 Node->Label = (STRPTR)ThisTag->ti_Data;
  1284.  
  1285.             if(ThisTag = FindTagItem(LA_LabelID,TagList))
  1286.             {
  1287.                 if(handle->LocaleHook)
  1288.                     Node->Label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)ThisTag->ti_Data);
  1289.             }
  1290.  
  1291.             if(ThisTag = FindTagItem(GA_Disabled,TagList))
  1292.             {
  1293.                 if((Node->Disabled && ThisTag->ti_Data) || (!Node->Disabled && !ThisTag->ti_Data))
  1294.                 {
  1295.                     if(!NewTags)
  1296.                         NewTags = CloneTagItems(TagList);
  1297.  
  1298.                     if(NewTags)
  1299.                         FilterTagItems(NewTags,Filter,TAGFILTER_NOT);
  1300.                 }
  1301.                 else
  1302.                 {
  1303.                     Node->Disabled = ThisTag->ti_Data;
  1304.  
  1305.                     if(Gadget)
  1306.                     {
  1307.                         struct Gadget *gad;
  1308.  
  1309.                         switch(Node->Type)
  1310.                         {
  1311. #ifdef DO_LEVEL_KIND
  1312.                             case LEVEL_KIND:
  1313.  
  1314.                                 gad = Gadget;
  1315.                                 break;
  1316. #endif    /* DO_LEVEL_KIND */
  1317.  
  1318.                             case TEXT_KIND:
  1319.  
  1320.                                 gad = Node->Special.Text.Picker;
  1321.                                 break;
  1322.  
  1323.                             case STRING_KIND:
  1324.  
  1325.                                 gad = Node->Special.String.Picker;
  1326.                                 break;
  1327.  
  1328.                             case INTEGER_KIND:
  1329.  
  1330.                                 LTP_FixState(handle,Node->Disabled,Node->Special.Integer.LeftIncrementer,GFLG_DISABLED);
  1331.  
  1332.                                 gad = Node->Special.Integer.RightIncrementer;
  1333.                                 break;
  1334.  
  1335.                             case TAPEDECK_KIND:
  1336.  
  1337.                                 gad = Node->Host;
  1338.  
  1339.                                 Gadget = NULL;
  1340.  
  1341.                                 break;
  1342.  
  1343.                             case PALETTE_KIND:
  1344.  
  1345.                                 gad = Node->Special.Palette.Picker;
  1346.                                 break;
  1347.  
  1348.                             case BUTTON_KIND:
  1349.  
  1350.                                 if(Node->Special.Button.ButtonImage)
  1351.                                 {
  1352.                                     gad = Node->Host;
  1353.  
  1354.                                     Gadget = NULL;
  1355.  
  1356.                                     break;
  1357.                                 }
  1358.  
  1359.                                 // FALLS THROUGH TO
  1360.  
  1361.                             default:
  1362.  
  1363.                                 gad = NULL;
  1364.                                 break;
  1365.                         }
  1366.  
  1367.                         LTP_FixState(handle,Node->Disabled,gad,GFLG_DISABLED);
  1368.                     }
  1369.                 }
  1370.             }
  1371.  
  1372.             if(Exclude)
  1373.             {
  1374.                 ULONG Filter[2];
  1375.  
  1376.                 Filter[0] = Exclude;
  1377.                 Filter[1] = TAG_DONE;
  1378.  
  1379.                 if(!NewTags)
  1380.                     NewTags = CloneTagItems(TagList);
  1381.  
  1382.                 if(NewTags)
  1383.                     FilterTagItems(NewTags,Filter,TAGFILTER_NOT);
  1384.             }
  1385.  
  1386.             if(Gadget)
  1387.             {
  1388.                 struct TagItem *tags = TagList;
  1389.  
  1390.                 if(NewTags)
  1391.                     tags = NewTags;
  1392.  
  1393.                 if(!V39 && Node->Disabled && Node->Type == SLIDER_KIND)
  1394.                 {
  1395.                     GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  1396.                         GA_Disabled,    FALSE,
  1397.                     TAG_MORE,tags);
  1398.  
  1399.                     GT_SetGadgetAttrs(Gadget,handle->Window,NULL,
  1400.                         GA_Disabled,    TRUE,
  1401.                     TAG_DONE);
  1402.                 }
  1403.                 else
  1404.                     GT_SetGadgetAttrsA(Gadget,handle->Window,NULL,tags);
  1405.             }
  1406.  
  1407.             if(Node->Type == STRING_KIND || Node->Type == PASSWORD_KIND)
  1408.                 LTP_PutStorage(Node);
  1409.  
  1410.             FreeTagItems(NewTags);
  1411.         }
  1412.     }
  1413. }
  1414.